using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ByHand.Model
{
    public class Log
    {
        public int ID { set; get; }
        public int OrderID { set; get; }
        public int ActionType { set; get; }
        public int ActionDetail { set; get; }
        public int ProductID { get; set; }
        public string RefID { get; set; }
        private string location;
        public string Location
        {
            get { return location; }
            set
            {
                location = value;
                var domain = value;
                if (!string.IsNullOrWhiteSpace(value))
                {
                    try
                    {
                        domain = new Uri(value).Host;
                    }
                    catch (Exception)
                    {

                        domain = "";
                    }
                }
                RefDomain = domain;
            }
        }
        public string UserName { set; get; }
        public DateTime DateTime { set; get; }
        public string UserType { get; set; }
        public string ByHandName { get; set; }
        public string MoreInfo { get; set; }
        public string RefDomain { get; private set; }
    }
}
